<%--@ page language="java" contentType="text/html; charset=ISO-8859-1" --%>

<jsp:include  page="header.jsp"></jsp:include>
<%@ page import="uk.ac.sanger.*" %>

<html>

<body>

 <% 
    String action = request.getParameter("action");
    String caption="";
    String mode_del="";
    String attribute="";
    
    String group="";
    group= request.getParameter("group");
    //get coordinate system name
   	String system_name =(String) session.getAttribute("system_name");
    
    //get attribute by groupid
    if (action.equals("delete")){
    	if (!group.equals("")){
    		DataManager dbM = new DataManager();
    		String system_uri = request.getParameter("uri");
	    	attribute=""+dbM.getAttributeById(group,system_uri);
    }}
	else
  	    attribute="";
    %>
<h1>Coordinate system : </h1>
<h1><%=system_name%></h1>

<% if (action.equals("add")) { 
      caption ="add group";
      group="";
      mode_del="background-color:white;";%>
<FORM METHOD="POST" ACTION="/writebackServlet/writebackGroups">
<%} %>
<% if (action.equals("delete")) { 
      caption ="delete group";
      mode_del ="background-color:#CCCCCC; \"readonly\"" ;
      %>
<FORM METHOD="POST" ACTION="/writebackServlet/writebackDeleteGroup?group = "<%= session.getAttribute("group") %>>
<%} %>

<div id="table">
<table>

<TR id="row0">
<TD colspan="2" ALIGN="RIGHT">   </TD>
</TR>

<TR id="row0">
<TD ALIGN="RIGHT">GROUP ID</TD>
<TD> <INPUT TYPE="text" NAME="groupid" VALUE="<%= group %>" SIZE=50 MAXLENGTH=30 style="width:350px;height:22px; <%= mode_del %> "></TD>
</TR>

<TR id="row0">
<TD ALIGN="RIGHT">ATTRIBUTES</TD>
<TD><INPUT TYPE="text" NAME="attributes" VALUE="<%= attribute %>" SIZE=50 MAXLENGTH=50 style="width:350px;height:22px; <%= mode_del %> "></TD>
</TR>

<TR id="row0" VALIGN="JUSTIFY">
<TD></TD> 
<TD ALIGN="RIGHT"><P><INPUT TYPE="submit" NAME="submit" VALUE="<%= caption %>" class="red-button"></P></TD>
</TR>

<%String system_uri = request.getParameter("uri"); %>
<p>
Show features in this group <A href="show_features.jsp?action=show_group&group=<%= group %>&uri=<%=system_uri%>">feature list</A>. 
</p>

</table>
</div>

</body>
</html>
<jsp:include  page="footer.jsp"/>
